import constConfig from '../constant'
import { ReactVideo, useSetErrorCode } from '../react-video'
import omit from 'lodash-es/omit'

const Index = props => {
  const { useCustomLoader, hideProgress = true, hideSpeed = true } = props

  const hlsConfig = constConfig.hlsConfig
  return (
    <div style={constConfig.style}>
      <ReactVideo
        {...omit(props, ['style'])}
        playType="HLS"
        style={constConfig.style}
        hideProgress={hideProgress}
        hideSpeed={hideSpeed}
        hideNext
        hideJuji
        hlsConfig={hlsConfig}
        useCustomLoader={useCustomLoader}
      />
    </div>
  )
}
Index.useSetErrorCode = useSetErrorCode
export default Index
